From: Guido Günther Date: Sun, 4 Jan 2026 12:07:31 +0000 (+0100) Subject: mixer-control: Reset `stream-id`s on UI devices X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2^2^2^2^2~7 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=62faf199403ca701b3aa0d294ea7846712fe33df;p=gnome-shell.git mixer-control: Reset `stream-id`s on UI devices If we find a matching UI device for a stream matching card and port and the same stream is also on another port, reset that UI devices `stream-id`. Since wireplumber 1.5.84 will merely flip the port but not the `stream-id` we need to make sure the UI device loses its stream-id. Otherwise `gvc_mixer_control_change_output` will try a `gvc_mixer_stream_change_port` which seemingly succeeds but fails silently as the port doesn't exist on that stream at the moment. By resetting the `stream-id` we ensure that we take the `gvc_mixer_control_change_profile_on_selected_device` code path in `gvc_mixer_control_change_output` instead and thus the sink/port gets properly selected. Signed-off-by: Guido Günther Origin: https://gitlab.gnome.org/GNOME/libgnome-volume-control/-/merge_requests/31 Bug: https://gitlab.gnome.org/GNOME/libgnome-volume-control/-/issues/34 Bug-Debian: https://bugs.debian.org/1126514 Applied-upstream: gnome-shell 50, commit:798230599950607ec285daecd070f5bcb28580e4 Gbp-Pq: Topic libgvc Gbp-Pq: Name mixer-control-Reset-stream-id-s-on-UI-devices.patch --- diff --git a/subprojects/gvc/gvc-mixer-control.c b/subprojects/gvc/gvc-mixer-control.c index b8198d383..6653d9420 100644 --- a/subprojects/gvc/gvc-mixer-control.c +++ b/subprojects/gvc/gvc-mixer-control.c @@ -1257,23 +1257,29 @@ match_stream_with_devices (GvcMixerControl *control, stream_port->port, stream_card_id); - if (stream_card_id == card_id && - g_strcmp0 (device_port_name, stream_port->port) == 0) { - g_debug ("Match device with stream: We have a match with description: '%s', origin: '%s', cached already with device id %u, so set stream id to %i", - description, - origin, - gvc_mixer_ui_device_get_id (device), - stream_id); - - g_object_set (G_OBJECT (device), - "stream-id", stream_id, - NULL); - in_possession = TRUE; + if (stream_card_id == card_id) { + if (g_strcmp0 (device_port_name, stream_port->port) == 0) { + g_debug ("Match device with stream: We have a match with description: '%s', origin: '%s', cached already with device id %u, so set stream id to %i", + description, + origin, + gvc_mixer_ui_device_get_id (device), + stream_id); + + g_object_set (G_OBJECT (device), + "stream-id", stream_id, + NULL); + in_possession = TRUE; + } else { + /* Other UI devices on that card that match the stream can't be valid */ + if (device_stream_id == stream_id) { + g_object_set (G_OBJECT (device), + "stream-id", GVC_MIXER_UI_DEVICE_INVALID, + NULL); + g_debug ("Found another UI device for this stream: %d, resetting", stream_id); + } + } } } - - if (in_possession == TRUE) - break; } return in_possession;